#ifndef __MEDIAAPI_H__
#define __MEDIAAPI_H__
#include "MediaPack.h"
#include <jmutex.h>
#include <jthread.h>
class MediaApi
{
public:
	MediaApi();
	~MediaApi();
	void PutCount(int num);
	int PutLocal(int num,char* localddr, unsigned int main_port);
	int PutDestion(int num, int count, char* desaddr, unsigned int main_rport);
	int FindState(int num);
	int MediaPlay(int num, int count);
	int MediaStop(int num, int count);
	int GetLocalPort(int num,int count);
	int UpdateState(int num,int count);
	int ReState(int num,int count);
	int Monitor(int num,int count);
	int CancelMonit(int num,int count);
	void SetRadio(bool isRadio);
	int PlayRing(int num);
	int StopPlayRing(int num);
public:
	bool isMonitor;
	bool isRightMonitor;
protected:
	int m_preState;
	int m_preStateRight;
	bool m_isRight;
	JMutex m_radiomutex;
	UDPMap t_udpMap;
	JMutex m_udpmutex;
// 	char m_localaddr[32];
// 	char m_desaddr[32];
// 	unsigned int m_port;
// 	unsigned int m_rport;
	
};
#endif